Skip to content

feat: consolidate 1.21-1.21.5, 1.21.6-1.21.11, 26.1.x, 26.2 support into one Stonecutter source tree#20

Merged
dsnsgithub merged 7 commits into
mainfrom
cursor/stonecutter-multiversion-b333
Jul 2, 2026
Merged

feat: consolidate 1.21-1.21.5, 1.21.6-1.21.11, 26.1.x, 26.2 support into one Stonecutter source tree#20
dsnsgithub merged 7 commits into
mainfrom
cursor/stonecutter-multiversion-b333

Conversation

@dsnsgithub

@dsnsgithub dsnsgithub commented May 8, 2026

Copy link
Copy Markdown
Owner

What changed

Replaces the three-branch maintenance flow with a single Stonecutter source tree that builds four version-specific jars from main:

Jar MC range Java
betterhud-2.1.1+mc1.21.jar 1.21 – 1.21.5 21
betterhud-2.1.1+mc1.21.6.jar 1.21.6 – 1.21.11 21
betterhud-2.1.1+mc26.1.jar 26.1 25
betterhud-2.1.1+mc26.2.jar 26.2+ 25

Every jar:

  • Requires fabric-api, modmenu, and cloth-config2 at runtime (no bundled deps — ~47 KB each).
  • Includes 26.2 features on all variants: per-element Scale setting, matrix-transform scaling in BetterHUDGUI, and the updated layout helpers (scaledElementWidth / scaledElementHeight).

Build commands

./gradlew build              # all four jars
./gradlew :26.2:build        # one variant
./gradlew "Set active project to 1.21"   # switch IDE active source
./gradlew "Reset active project"         # back to 26.2 (VCS form)

Version-specific API differences (Stonecutter directives)

Only the lines that genuinely differ per MC version use //? if directives:

Concern 1.21 1.21.6+ 26.1 26.2
HUD registration HudRenderCallback HudElementRegistry HudElementRegistry + Identifier same
Draw context GuiGraphics GuiGraphics GuiGraphicsExtractor same
Text draw drawString() drawString() text() same
Scale transform PoseStack Matrix3x2fStack Matrix3x2fStack same
Hide HUD check options.hideGui same same gui.hud.isHidden()
Biome lookup Optional<ResourceKey> same Holder same

Project layout

versions/
├── 1.21/gradle.properties      # MC 1.21,  fabric-api 0.102.0+1.21
├── 1.21.6/gradle.properties    # MC 1.21.9, fabric-api 0.134.0+1.21.9
├── 26.1/gradle.properties      # MC 26.1,  fabric-api 0.145.1+26.1
└── 26.2/gradle.properties      # MC 26.2,  fabric-api 0.154.0+26.2
src/main/                       # single source tree (active form = 26.2)

After merge

The support/1.21-* branches can be deleted. To add a future MC version, drop a versions/<ver>/gradle.properties and add it to settings.gradle.

Open in Web Open in Cursor 

cursoragent and others added 7 commits May 8, 2026 01:06
Migrates the mod from 3 separate branches (main 26.1, support/1.21-1.21.5,
support/1.21.6-1.21.11) to a single source tree using Stonecutter 0.9.3.

- All variants now use Mojang official mappings (yarn sources for the support
  branches were converted with loom's migrateMappings task).
- Per-version gradle.properties under versions/ pin MC, fabric-api, modmenu,
  cloth-config, loader, and target Java version.
- Single root build.gradle uses stonecutter.eval(...) to switch between
  fabric-loom (26.1, unobfuscated) and fabric-loom-remap (1.21.x, obfuscated).
- Source files use //? if mc directives where the API genuinely differs:
  HudElementRegistry vs HudRenderCallback, Identifier vs ResourceLocation,
  GuiGraphicsExtractor vs GuiGraphics, drawContext.text vs .drawString,
  Holder vs Optional<ResourceKey> in Biome lookup, FPS via accessor mixin
  on 1.21.x.

The active VCS variant is 26.1 so 'git diff main' stays small.

Co-authored-by: Dominic Seung <dominic@seung.dev>
- Stonecutter uses '//? if >=1.21.6 {' (no 'mc' keyword, no quotes around
  versions) - my previous '//? if mc >= "..." {' format was rejected by the
  parser.
- client.getFps() is public on all Mojang-mapped variants (1.21, 1.21.6+,
  26.1), so the MinecraftClientAccessor mixin was redundant. Drop it and the
  empty mixin/ package; betterhud.mixins.json keeps an empty client array via
  expansion.
- Earlier I'd assumed 26.1 used getDebugHud()/hudHidden (yarn-like) names,
  but main 26.1 already uses getDebugOverlay()/hideGui (true Mojang) - same
  as the 1.21.x Mojang-migrated source. Removed the bogus directives that
  swapped between them.

After these fixes, all three variants build successfully:
  ./gradlew build
    -> versions/1.21/build/libs/betterhud-2.1.0+mc1.21.jar
    -> versions/1.21.6/build/libs/betterhud-2.1.0+mc1.21.6.jar
    -> versions/26.1/build/libs/betterhud-2.1.0+mc26.1.jar

CI workflow updated to a 3-way matrix (mc1.21/Java21, mc1.21.6/Java21,
mc26.1/Java25) that uploads each variant as a separate artifact.

Co-authored-by: Dominic Seung <dominic@seung.dev>
- Add four Stonecutter variants: 1.21 (1.21-1.21.5), 1.21.6 (1.21.6-1.21.11),
  26.1 (>=26.1 <26.2), 26.2 (>=26.2).
- All jars now declare fabric-api, modmenu, and cloth-config2 as hard runtime
  dependencies instead of bundling them (~47 KB jars vs ~2 MB before).
- Port 26.2 scaling (Matrix3x2fStack / PoseStack transforms, scaledElement*
  layout helpers, Scale setting) to every variant via Stonecutter directives.
- 26.2 uses client.gui.hud.isHidden(); all other variants use options.hideGui.
- Update to mod 2.1.1, loom 1.17-SNAPSHOT, Gradle 9.5.1; CI matrix covers all
  four variants.

Co-authored-by: Dominic Seung <dominic@seung.dev>
Merge origin/main into cursor/stonecutter-multiversion-b333, keeping the
Stonecutter four-variant layout while incorporating main's 26.2 changes
(scaling, required fabric-api/modmenu/cloth-config deps, gui.hud.isHidden).

Resolved conflicts in build.gradle, gradle.properties, BetterHUDGUI.java,
CustomText.java, ModSettings.java, fabric.mod.json, and removed a duplicate
createFloatSetting() introduced by the auto-merge in Setting.java.

Co-authored-by: Dominic Seung <dominic@seung.dev>
Merge origin/main; resolve build.yml conflict by keeping the four-variant
Stonecutter matrix while adopting main's on: push trigger (no pull_request).

Co-authored-by: Dominic Seung <dominic@seung.dev>
Use a single implCfg (modImplementation vs implementation) and only gate
mappings loom.officialMojangMappings() behind isLegacy.

Co-authored-by: Dominic Seung <dominic@seung.dev>
@dsnsgithub dsnsgithub marked this pull request as ready for review July 2, 2026 10:57
@dsnsgithub dsnsgithub changed the title feat: consolidate 1.21, 1.21.6, 26.1 support into one Stonecutter source tree feat: consolidate 1.21-1.21.5, 1.21.6-1.21.11, 26.1.x, 26.2 support into one Stonecutter source tree Jul 2, 2026
@dsnsgithub dsnsgithub merged commit 0872f15 into main Jul 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants